package views.mail;

import java.awt.BorderLayout;

import views.others.AbstractView;
import controllers.OngletMailsController;

/**
 *
 *
 */
public class OngletMailsView extends AbstractView
{
	private static final long serialVersionUID = 1L;
	private MailPanel mailPane;

	/**
	 * Constructeur de l'onglet JMail
	 * @param controller
	 */
	public OngletMailsView(OngletMailsController controller)
	{
		super(controller);

		this.setLayout(new BorderLayout(0, 0));

		mailPane = new MailPanel(controller);
		add(mailPane, BorderLayout.CENTER);

	}

	/**
	 *
	 * @return le panel des mails
	 */
	public MailPanel getMailPane() {
		return mailPane;
	}

	/**
	 * Accesseur du controleur de cette view
	 */
	public OngletMailsController getController() {
		return (OngletMailsController)controller;
	}

	/**
	 * Modifie le controleur de cette view
	 */
	public void setController(OngletMailsController controller) {
		this.controller = controller;
	}
	
	public void refresh()
	{
		this.getMailPane().updateListeMails();
	}
}
